package com.xqit.ydzhkt.answer.service.impl;

import com.xqit.ydzhkt.answer.mapper.AddAnswerMapper;
import com.xqit.ydzhkt.answer.service.AddAnswerService;
import com.xqit.ydzhkt.answer.service.AddQuestionService;
import com.xqit.ydzhkt.entity.AnswerEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Janus on 2020/6/10
 */
@Service
public class AddAnswerServiceImpl implements AddAnswerService {

    @Autowired
    private AddAnswerMapper addAnswerMapper;

    @Override
    public void addAnswer( int userId, int questionId, String answerContent) {
        addAnswerMapper.addAnswer(userId,questionId,answerContent);

        addAnswerMapper.updateReply(questionId);
    }
}
